<template>
  <div>
    <el-row style=" background: #fff;height: 60px" class="pt-2 pb-2 pl-3 pr-3">
      <el-col :span="24">
        <div style="float: left;margin-top: 10px;margin-left: 10px">
          <el-form :inline="true" :model="task" :rules="rules" ref="task" class="demo-form-inline">
            <el-form-item label="姓名" prop="commitName">
              <el-input style="width: 120px" :disabled="shztGhb === '1'" maxlength="15"  v-model="task.commitName" placeholder="填报人姓名"></el-input>
            </el-form-item>
            <el-form-item label="职务" prop="commitJob">
              <el-input style="width: 250px" :disabled="shztGhb === '1'" maxlength="30" v-model="task.commitJob" placeholder="填报人职务"></el-input>
            </el-form-item>
            <el-form-item label="座机号" prop="commitFixedNum">
              <el-input style="width: 120px" :disabled="shztGhb === '1'" maxlength="15" v-model="task.commitFixedNum" placeholder="填报人座机号"></el-input>
            </el-form-item>
            <el-form-item label="手机号" prop="commitPhoneNum">
              <el-input style="width: 120px" :disabled="shztGhb === '1'" maxlength="15" v-model="task.commitPhoneNum" placeholder="填报人手机号"></el-input>
            </el-form-item>
          </el-form>
        </div>
        <div style="float: right;">
          选择年度:
          <el-select style="width: 100px;margin-top: 10px" v-model="assessYear" placeholder="选择年度" @change = "selectDateChange">
            <el-option
              v-for="item in assessYearOption"
              :key="item.value"
              :label="item.label"
              :value="item.value" />
          </el-select>
          <el-button style="margin-top: 10px" type="primary"  plain @click="downZip"
          >&nbsp;导出<i class="el-icon-upload el-icon--right"></i>
          </el-button>
          <el-button style="margin-top: 10px" type="primary" icon="el-icon-edit" plain
                     @click="subInfo(-1,'task')" :disabled="shztGhb === '1'">&nbsp;保存
          </el-button>
          <el-button style="margin-top: 10px" type="primary" icon="el-icon-edit" plain
                     @click="subInfo(0,'task')" :disabled="shztGhb === '1'">&nbsp;上报
          </el-button>
          <el-button style="margin-right: 10px;margin-top: 10px" type="primary" icon="el-icon-delete" plain
                     @click="delRow" :disabled="shztGhb === '1'">&nbsp;删除
          </el-button>
        </div>
      </el-col>
    </el-row>
    <el-row style="background: #fff;height: 50px; margin-top:5px;" class="pt-2 pb-2 pl-3 pr-3" v-loading="pageLoading">
      <vxe-table
        border
        stripe
        :height="winHeight"
        :data="infoData"
        :span-method="arraySpanMethod"
        :align="allAlign='center'"
        :cell-style="cellStyle"
        :cell-class-name="cellClassName"
        highlight-current-row
        :row-config="{isCurrent: true}"
        @cell-click="handleCurrentChange"
      >
        <vxe-column  title="指标项目"  width="5%" >
          <template #default="{ row }">
            <span v-html="row.zbxm"></span>
          </template>
        </vxe-column>
        <vxe-column  title="评估内容"  width="5%" >
          <template #default="{ row }">
            <span v-html="row.pgnr"></span>
          </template>
        </vxe-column>
        <vxe-column title="评估标准" width="15%">
          <template #default="{ row }">
            <span v-if="row.pgbzId == '999'">
              <el-input :disabled="shztGhb == '1'"  maxlength="300" type="textarea" :rows="3"
                        v-model="row.tsqksm" placeholder="请输入特殊情况说明"></el-input>
            </span>
            <span v-else v-html="row.pgbz"></span>
          </template>
        </vxe-column>
        <vxe-column  title="工作进展" width="20%">
          <template #default="{ row }">
            <span v-if="row.pgbzId != '999' && row.pgbzId != '9999'">
               <el-input v-if="row.columnType == '1' && row.pgbzId != '6'"
                         v-model="row.gzjz" placeholder="请输入工作进展(200字以内)" maxlength="200"
                         :disabled="shztGhb === '1' || row.shzt == '1' || row.shzt === '5'" type="textarea" :rows="3" autosize>
              </el-input>
              <el-button :disabled="shztGhb == '1'" v-else-if="row.columnType == '2' && row.pgbzId !== '8' && row.pgbzId !== '9'" type="primary"
                         @click="addNewCont(row)">新增</el-button>
              <el-upload 
                  style="margin-bottom: 5px"   
                  class="upload-demo"
                  accept=".pdf"
                  :action="fileServerPath"
                  v-else-if="row.columnType == '2' && row.pgbzId == '8'"
                  :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                  :show-file-list="false"
                  :on-success="(response, file, fileList)=> fileUploadFeature(response, file, 'tscx',row)"
                  :before-upload="beforeAvatarUpload"
                  :multiple="false">
                  <div>特色创新做法附件：
                  <div v-for="(item,i) in list1.fileMc" :key="i" style="margin-bottom: 5px">
                        <el-button style="margin-left: 20px" type="danger"
                                  icon="el-icon-delete" circle size="mini"
                                  :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                                  @click.stop="delFileBySortFeature(i,list1.id)">
                        </el-button>
                        <el-link   type="primary" @click.stop="showFile(list1.fileUrl[i])">
                          {{i + 1}} 、 {{item}}
                        </el-link>
                      </div>
                  </div>
                    <el-button :disabled="shztGhb == '1'" type="primary"
                        >特色创新做法<i class="el-icon-upload el-icon&#45;&#45;right"></i></el-button>
              </el-upload>
              <p style="display: flex;justify-content: center;" v-else-if="row.columnType == '4' && row.pgbzId == '9'">
                <el-upload 
                  style="margin-bottom: 5px;margin-right:10px;"   
                  class="upload-demo"
                  accept=".xls,.xlsx,.xlsm,.xlsb,.xltx,.xltm,.csv"
                  :action="fileServerPath"
                  :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                  :show-file-list="false"
                  :on-success="(response, file, fileList)=> fileUploadFeature(response, file, 'ndgbtz_execl',row)"
                  :before-upload="beforeExeclUpload"
                  :multiple="false">
                  <div>上传年度干部选拔名单表格附件：
                  <div v-for="(item,i) in list2.fileMc" :key="i" style="margin-bottom: 5px">
                        <el-button style="margin-left: 20px" type="danger"
                                  icon="el-icon-delete" circle size="mini"
                                  :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                                  @click.stop="delFileBySortFeature(i,list2.id)">
                        </el-button>
                        <el-link   type="primary" @click.stop="showExeclFile(list2.fileUrl[i])">
                          {{i + 1}} 、 {{item}}
                        </el-link>
                      </div>
                  </div>
                    <el-button :disabled="shztGhb == '1'" type="primary"
                        >上传年度干部选拔名单表格<i class="el-icon-upload el-icon&#45;&#45;right"></i></el-button>
              </el-upload>
              <el-upload 
                  style="margin-bottom: 5px"   
                  class="upload-demo"
                  accept=".pdf"
                  :action="fileServerPath"
                  :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                  :show-file-list="false"
                  :on-success="(response, file, fileList)=> fileUploadFeature(response, file, 'ndgbtz_pdf',row)"
                  :before-upload="beforeAvatarUpload"
                  :multiple="false">
                  <div>上传年度干部选拔名单盖章扫描件附件：
                  <div v-for="(item,i) in list3.fileMc" :key="i" style="margin-bottom: 5px">
                        <el-button style="margin-left: 20px" type="danger"
                                  icon="el-icon-delete" circle size="mini"
                                  :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                                  @click.stop="delFileBySortFeature(i,list3.id)">
                        </el-button>
                        <el-link   type="primary" @click.stop="showFile(list3.fileUrl[i])">
                          {{i + 1}} 、 {{item}}
                        </el-link>
                      </div>
                  </div>
                    <el-button :disabled="shztGhb == '1'" type="primary"
                        >上传年度干部选拔名单盖章扫描件<i class="el-icon-upload el-icon&#45;&#45;right"></i></el-button>
              </el-upload>
              </p>
              <span v-else-if="row.columnType == '1' && row.pgbzId == '6'">
                <div style="font-size: 18px;font-weight: 800;" >年初制定</div>
                <el-link  type="primary" @click="showPbtsjh(shztGhb,'1')">配备提升计划表</el-link>
              </span>
            </span>
          </template>
        </vxe-column>
        <vxe-column  title="证明材料" width="25%">
          <template #default="{ row }">
            <span v-if="row.pgbzId != '999' && row.pgbzId != '9999'">
              <span v-if="row.columnType == '1' && row.pgbzId != '6'">
                <div>附件：
                  <div v-for="(item,i) in row.fileMc" style="margin-bottom: 5px">
                    <el-button style="margin-left: 20px" type="danger"
                               icon="el-icon-delete" circle size="mini"
                               :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                               @click="delFileBySort(i,row.id)">
                    </el-button>
                    <el-link   type="primary" @click="showFile(row.fileUrl[i])">
                      {{i + 1}} 、 {{item}}
                    </el-link>
                  </div>

                </div>
                <el-upload style="margin-bottom: 5px"   class="upload-demo"
                           accept=".pdf"
                           :action="fileServerPath"
                           :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                           :show-file-list="false"
                           :on-success="(response, file, fileList)=> fileUpload(response, file, fileList,row)"
                           :before-upload="beforeAvatarUpload"
                           :multiple="false">
                  <el-button size="small" type="primary" :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'">
                      附件上传<i class="el-icon-upload el-icon&#45;&#45;right"></i>
                  </el-button>
                </el-upload>
              </span>
              <span v-else-if="row.columnType == '1' && row.pgbzId == '6'">
                <div style="font-size: 18px;font-weight: 800;" >年中统计</div>
                <el-link  type="primary" @click="showTjqktj(shztGhb,'1')">推进情况统计表</el-link>
              </span>
            </span>
          </template>
        </vxe-column>
        <vxe-column title="单项分值" width="10%">
          <template #default="{ row }">
            <span v-if="row.pgbzId != '999' && row.pgbzId != '9999'">
              <el-input v-if="row.columnType == '1' && row.pgbzId != '6' && row.pgbzId != '7'"
                        v-model="row.fxjf" placeholder="请输入扣分分值" maxlength="4"
                        :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                        oninput="value = value.match(/^\d*(\.?\d{0,1})/g)[0]" prefix-icon="el-icon-minus"></el-input>

              <el-input v-if="row.columnType == '1' && row.pgbzId != '6' && row.pgbzId == '7'"
                        v-model="row.fxjf" placeholder="请输入加分分值" maxlength="5" prefix-icon="el-icon-plus"
                        :disabled="shztGhb === '1' || row.shzt == '1'||row.shzt === '5'"
                        oninput="value = value.replace(/[^\d.]/g,'');value = value.match(/^\d*(\.?\d{0,2})/g)[0]"></el-input>

              <span v-else-if="row.columnType == '1' && row.pgbzId == '6'">
                <div style="font-size: 18px;font-weight: 800;" >年底评估</div>
                <el-link  type="primary" @click="showWcqktj(shztGhb,'1')">完成情况统计表</el-link>
              </span>
            </span>
          </template>
        </vxe-column>
        <vxe-column  title="审核状态" width="5%">
          <template #default="{ row }">
            <span v-if="row.pgbzId != '999' && row.pgbzId != '9999'">
              <span  v-if="row.columnType == '1' && row.pgbzId != '6'">
                <p v-if="row.shzt == '1'" style="font-size: 16px;font-weight: 800;color: green;">
                  审核通过
                </p>
                <p v-else-if="row.shzt == '0'" style="font-size: 16px;font-weight: 800;color: red;">
                  待审核
                </p>
                <p v-else-if="row.shzt == '2'"  style="font-size: 16px;font-weight: 800;color: red;">
                  退回修改
                </p>
                <p v-else-if="row.shzt == '3'"  style="font-size: 16px;font-weight: 800;color: red;">
                  补充材料
                </p>
                <p v-else-if="row.shzt == '5'"  style="font-size: 16px;font-weight: 800;color: red;">
                  不通过
                </p>
              </span>
              <span v-else-if="row.columnType == '1' && row.pgbzId == '6'"></span>
            </span>
          </template>
        </vxe-column>
        <vxe-column  title="自评分值" width="10%">
          <template #default="{ row }">
            <span v-if="row.pgbzId != '999' && row.pgbzId != '9999'">
              <span v-if="row.pgbzId != '6'" v-html="row.zpfz"></span>
              <span v-if="row.pgbzId == '6'">按照年底汇总情况得分</span>
            </span>
            <span v-if="row.pgbzId == '999' ">
              <div>附件：
                <div v-for="(item,i) in row.fileMc" style="margin-bottom: 5px">
                  <a   @click="showFile(row.fileUrl[i])">
                    {{i + 1}} 、 {{item}}
                  </a>
                  <el-button style="margin-left: 20px" type="danger"
                             icon="el-icon-delete" circle size="mini"
                             :disabled="shztGhb == '1'"
                             @click="delFileByTsqk(i)">
                  </el-button>
                </div>

              </div>
              <el-upload style="margin-bottom: 5px"   class="upload-demo"
                         accept=".pdf"
                         :action="fileServerPath"
                         :show-file-list="false"
                         :on-success="(response, file, fileList)=> fileUpload(response, file, fileList,row)"
                         :before-upload="beforeAvatarUpload"
                         :multiple="false"
                         :disabled="shztGhb == '1'">
                <el-button :disabled="shztGhb == '1'" size="small" type="primary">
                    特殊情况附件<i class="el-icon-upload el-icon&#45;&#45;right"></i>
                </el-button>
              </el-upload>
            </span>
          </template>
        </vxe-column>
        <vxe-column field="shfz" title="审核分值" width="5%"></vxe-column>
      </vxe-table>

    </el-row>
    <archiveFile-show ref="dialogarchiveFile"/>
    <pbtsjhTable-sz ref="dialogpbtsjhTableSz"/>
    <pbtsjhTable-ds ref="dialogpbtsjhTableDs"/>
    <wcqktjTable-sz ref="dialogwcqktjTableSz"/>
    <wcqktjTable-ds ref="dialogwcqktjTableDs"/>
    <tjqktjTable-sz ref="dialogtjqktjTableSz"/>
    <tjqktjTable-ds ref="dialogtjqktjTableDs"/>
    <pbtsjhTable2023-ds ref="dialogpbtsjhTableDs2023"/>
    <wcqktjTable2023-ds ref="dialogwcqktjTableDs2023"/>
    <tjqktjTable2023-ds ref="dialogtjqktjTableDs2023"/>
    <pbtsjhTable2023-sz ref="dialogpbtsjhTableSz2023"/>
    <wcqktjTable2023-sz ref="dialogwcqktjTableSz2023"/>
    <tjqktjTable2023-sz ref="dialogtjqktjTableSz2023"/>
    <wcqktjTable2023-sg ref="dialogwcqktjTableSg2023"/>
    <tjqktjTable2023-sg ref="dialogtjqktjTableSg2023"/>
    <pbtsjhTable2023-sg ref="dialogpbtsjhTableSg2023"/>
    <!-- 年初地市 -->
    <pbtsjhTable2024-ds ref="dialogpbtsjhTableDs2024"/>
    <!-- 年初省直 -->
    <pbtsjhTable2024-sz ref="dialogpbtsjhTableSz2024"/>
    <!-- 年初省管 -->
    <pbtsjhTable2024-sg ref="dialogpbtsjhTableSg2024"/>
  </div>
</template>
<script>
import {generateUUID,getFillingData,saveInfoData,saveInfoData2024,downExecl,downExecl2024,selectSH,updateLogType,getFillingData2024} from '@/api/young/evaluation/infoFilling/infoFilling.js'
import {selectRole} from '@/api/young/evaluation/evaluationConfig/evaluation.js'
import webapp from "@/config/webapp";
import archiveFileShow from '@/views/young/evaluation/archiveFile'
import pbtsjhTableSz from '@/views/young/evaluation/infoFilling/pbtsjhTable_sz'
import pbtsjhTableDs from '@/views/young/evaluation/infoFilling/pbtsjhTable_ds'
import wcqktjTableSz from '@/views/young/evaluation/infoFilling/wcqktjTable_sz'
import wcqktjTableDs from '@/views/young/evaluation/infoFilling/wcqktjTable_ds'
import tjqktjTableSz from '@/views/young/evaluation/infoFilling/tjqktjTable_sz'
import tjqktjTableDs from '@/views/young/evaluation/infoFilling/tjqktjTable_ds'
import pbtsjhTableDs2023 from '@/views/young/evaluation/infoFilling/pbtsjhTable2023_ds'
import wcqktjTableDs2023 from '@/views/young/evaluation/infoFilling/wcqktjTable2023_ds'
import tjqktjTableDs2023 from '@/views/young/evaluation/infoFilling/tjqktjTable2023_ds'
import pbtsjhTableSz2023 from '@/views/young/evaluation/infoFilling/pbtsjhTable2023_sz'
import wcqktjTableSz2023 from '@/views/young/evaluation/infoFilling/wcqktjTable2023_sz'
import tjqktjTableSz2023 from '@/views/young/evaluation/infoFilling/tjqktjTable2023_sz'
import wcqktjTableSg2023 from '@/views/young/evaluation/infoFilling/wcqktjTable2023_sg'
import tjqktjTableSg2023 from '@/views/young/evaluation/infoFilling/tjqktjTable2023_sg'
import pbtsjhTableSg2023 from '@/views/young/evaluation/infoFilling/pbtsjhTable2023_sg'

import pbtsjhTableDs2024 from '@/views/young/evaluation/infoFilling/pbtsjhTable2024_ds'
import pbtsjhTableSz2024 from '@/views/young/evaluation/infoFilling/pbtsjhTable2024_sz'
import pbtsjhTableSg2024 from '@/views/young/evaluation/infoFilling/pbtsjhTable2024_sg'

import store from '@/store'

export default {
  name: 'infoFilling',
  components: {
    'archiveFile-show': archiveFileShow,
    'pbtsjhTable-sz': pbtsjhTableSz,
    'pbtsjhTable-ds': pbtsjhTableDs,
    'wcqktjTable-sz': wcqktjTableSz,
    'wcqktjTable-ds': wcqktjTableDs,
    'tjqktjTable-sz': tjqktjTableSz,
    'tjqktjTable-ds': tjqktjTableDs,
    'pbtsjhTable2023-ds': pbtsjhTableDs2023,
    'wcqktjTable2023-ds': wcqktjTableDs2023,
    'tjqktjTable2023-ds': tjqktjTableDs2023,
    'pbtsjhTable2023-sz': pbtsjhTableSz2023,
    'wcqktjTable2023-sz': wcqktjTableSz2023,
    'tjqktjTable2023-sz': tjqktjTableSz2023,
    'wcqktjTable2023-sg': wcqktjTableSg2023,
    'tjqktjTable2023-sg': tjqktjTableSg2023,
    'pbtsjhTable2023-sg': pbtsjhTableSg2023,
    // 地市年初
    'pbtsjhTable2024-ds':pbtsjhTableDs2024,
    'pbtsjhTable2024-sz':pbtsjhTableSz2024,
    'pbtsjhTable2024-sg':pbtsjhTableSg2024
  },
  data: () => ({
    winHeight:550,
    infoData:[],
    //行数记录器，记录各种行数
    hzColumn:{
    },
    //各
    sorts : {},
    jlzbFile:[],
    checkData:null,
    fileServerPath: webapp.GHB_URL+'/evaluation/excel/fileUpload',
    userInfo : store.getters.userInfo,
    role:'',
    taskId : '',
    assessYear:'2024',
    task:{
      commitName:'',
      commitJob:'',
      commitFixedNum:'',
      commitPhoneNum:'',
    },
    shztGhb : '',
    pageLoading : false,
    assessYearOption: [{
      value: '2022',
      label: '2022'
    }, {
      value: '2023',
      label: '2023'
    },{
      value: '2024',
      label: '2024'
    }],
    //表单校验
    rules: {
      commitName: [
        {required: true, message: '请输入填报人姓名', trigger: 'blur'}
      ],
      commitJob: [
        {required: true, message: '请输入填报人职务', trigger: 'blur'}
      ],
      commitFixedNum: [
        {required: true, message: '请输入填报人座机号', trigger: 'blur'}
      ],
      commitPhoneNum: [
        {required: true, message: '请输入填报人手机号', trigger: 'blur'}
      ],
    },
    fileType:"",
    response:{
      id:"",
      name:"",
      url:"",
    },
    responseFile:[],
    list1:{},
    list2:{},
    list3:{},
  }),

  watch : {
    infoData: {
      handler: function() {
        let fxjfSum1 = 0;
        let fxjfSum2 = 0;
        let fxjfSum3 = 0;
        this.infoData.forEach(item =>{
          if(item.pgbzId == '1' || item.pgbzId == '2' ){
            fxjfSum1  += Number(item.fxjf);
          }
          if(item.pgbzId == '3' || item.pgbzId == '4' || item.pgbzId == '5'){
            fxjfSum2  += Number(item.fxjf);
          }
          if(item.pgbzId == '7'){
            fxjfSum3  += Number(item.fxjf);
          }
        });
        /*  if (fxjfSum3>10) {
            fxjfSum3 = 10;
          }*/
        this.infoData[0].zpfz = (30 - fxjfSum1).toFixed(1);
        this.infoData[this.hzColumn.zrlsqkColumn].zpfz = (30 - fxjfSum2).toFixed(1);
        this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].zpfz = (0 + fxjfSum3).toFixed(2);
      },
      deep: true
    }
  },

  mounted() {
    this.initFillingData(this.assessYear);
    this.messageDate();
  },
  methods: {
    //数据初始化
    initFillingData(year){
      const param = {
        "userInfo" : JSON.parse(sessionStorage.getItem(`userInfo`)),
      };
      selectRole(param).then(result=>{
        this.role = '';
        var roles = '';
        result.resultdata.forEach((item)=>{
          roles += item;
        })
        if (roles.indexOf("系统管理员")>-1){
          this.role = "系统管理员";
        }else if (roles.indexOf("干部一处")>-1){
          this.role = "干部一处";
        }else if (roles.indexOf("干部二处")>-1){
          this.role = "干部二处";
        }else if (roles.indexOf("干部三处")>-1){
          this.role = "干部三处";
        }else if (roles.indexOf("干部四处")>-1){
          this.role = "干部四处";
        }else if (roles.indexOf("干部五处")>-1){
          this.role = "干部五处";
        }
        console.log(this.role)
      });
      this.pageLoading = true;
      const params = {
        "dwBianma" : JSON.parse(sessionStorage.getItem(`userInfo`)).organizeId,
        "dw" : JSON.parse(sessionStorage.getItem(`userInfo`)).organizeName,
        "userNameNo" : JSON.parse(sessionStorage.getItem(`userInfo`)).userAccount,
        "assessYear": ''
      };
      if (year){
        params.assessYear = year
      }
      this.$nextTick(() => {
        setTimeout(()=>{
          this.winHeight = window.innerHeight - 180;
        },100)
      })
      if(this.assessYear === "2023" || this.assessYear === "2022"){
        getFillingData(params).then(result => {
          this.infoData = []
          console.log(result)
          if(result.resultdata){
            this.fillingData(result)
            this.pageLoading = false;
          }
        }).catch(err => {
          this.$message({
            message: '系统错误，请重新登录再试。',
            type: 'warning'
          });
        })
      }else if(this.assessYear === "2024"){
        getFillingData2024(params).then((result) => {
          this.infoData = []
          console.log(result)
          if(result.resultdata){
            this.fillingData(result)
            this.pageLoading = false;
          }
          if(result.resultdata.jlzbFile){
            this.jlzbFile = result.resultdata.jlzbFile;
            // newFileList = {};
            result.resultdata.jlzbFile.forEach((item)=>{
              if(item.fileType === 'tscx'){
                this.list1 = item
              }
              if(item.fileType === 'ndgbtz_pdf'){
                this.list3 = item
              }
              if(item.fileType === 'ndgbtz_execl'){
                this.list2 = item
              }
            })
          }

        }).catch(err=>{
          this.$message({
            message: '系统错误，请重新登录再试。',
            type: 'warning'
          });
        })
      }

    },
    fillingData(result){
      if(result.resultdata.task){
        this.shztGhb = result.resultdata.task.shztGhb;
      }

      if(result.resultdata.hzColumn){
        this.hzColumn = result.resultdata.hzColumn;
      }
      if(result.resultdata.sorts){
        this.sorts = result.resultdata.sorts;
      }
      if(result.resultdata.infoData){
        this.taskId = result.resultdata.task.id;
        this.task = result.resultdata.task;
        this.shztGhb = result.resultdata.task.shztGhb;
        this.infoData = result.resultdata.infoData;
        this.infoData.push({
          "id" : "",
          "zbxm" : "特殊情况说明",
          "pgnr" : "特殊情况说明",
          "pgbz" : "特殊情况说明",
          "fileId" : [],
          "fileMc" : result.resultdata.task.fileMc,
          "fileUrl" : result.resultdata.task.fileUrl,
          "columnType" : "3",//表格类型，1-填报，2-新增按钮
          "tsqksm" : result.resultdata.task.tsqk,//特殊情况说明
          "taskId" : result.resultdata.task.id,//任务id
          "pgbzId" : "999",//评估标准id
        })
        this.selectSH(result.resultdata.task.id);
      }
      //分数
      if(result.resultdata.score){
        if(result.resultdata.score.scoreZp1 && result.resultdata.score.scoreZp1 != ""){
          this.infoData[0].zpfz = result.resultdata.score.scoreZp1;
        }else{
          this.infoData[0].zpfz = 30;
        }
        if(result.resultdata.score.scoreZp2 && result.resultdata.score.scoreZp2 != ""){
          this.infoData[this.hzColumn.zrlsqkColumn].zpfz = result.resultdata.score.scoreZp2;
        }else{
          this.infoData[this.hzColumn.zrlsqkColumn].zpfz = 30;
        }
        if(result.resultdata.score.scoreZp4 && result.resultdata.score.scoreZp4 != ""){
          this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].zpfz = result.resultdata.score.scoreZp4;
        }else{
          this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].zpfz = 0;
        }
        if(result.resultdata.score.scoreZp3 && result.resultdata.score.scoreZp3 != ""){
          this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn ].zpfz = result.resultdata.score.scoreZp3;
        }else{
          this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn ].zpfz = 30;
        }


        //审核分值回显
        if(result.resultdata.score.scoreSh1 && result.resultdata.score.scoreSh1 != ""){
          this.infoData[0].shfz = result.resultdata.score.scoreSh1;
        }
        if(result.resultdata.score.scoreSh2 && result.resultdata.score.scoreSh2 != ""){
          this.infoData[this.hzColumn.zrlsqkColumn].shfz = result.resultdata.score.scoreSh2;
        }
        if(result.resultdata.score.scoreSh4 && result.resultdata.score.scoreSh4 != ""){
          this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].shfz = result.resultdata.score.scoreSh4;
        }
        if(result.resultdata.score.scoreSh3 && result.resultdata.score.scoreSh3 != ""){
          this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn ].shfz = result.resultdata.score.scoreSh3;
        }
      }
    },
    //上报
    subInfo(subType,formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          let msgCont = "";
          //保存
          if (subType == -1) {
            msgCont = "保存";
          } else {
            msgCont = "上报";
          }
          if (subType == -1) {
            if(this.assessYear === "2022" || this.assessYear === "2023"){
              console.log(this.assessYear,"年份?")
             //保存
             this.$alert('是否' + msgCont + '?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning'
                }).then(() => {
                  this.pageLoading = true;
                  const scort = {
                    "scoreZp1": this.infoData[0].zpfz,
                    "scoreZp2": this.infoData[this.hzColumn.zrlsqkColumn].zpfz,
                    "scoreZp3": 30,
                    "scoreZp4": this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].zpfz,
                    "taskId": this.taskId
                  };
                  const params = {
                    "infoData": this.infoData,
                    "scorts": scort,
                    "userInfo": this.userInfo,
                    "task": this.task,
                    "subType": subType, //保存状态
                    "assessYear": this.assessYear,
                  };
                  debugger
                  saveInfoData(params).then(result => {
                    if (result.result) {
                      this.pageLoading = false;
                      // debugger
                      this.$alert('<strong>保存成功，如上报省委组织部，需再次点击上报按钮完成上报</strong>','提示', {
                        dangerouslyUseHTMLString: true,
                        confirmButtonText: '确定',
                        type:"success",
                        callback: action => {
                          this.initFillingData(this.assessYear);
                        },
                      });
                    }
                  }).catch(err => {
                    this.$message({
                      message: '系统错误，请重新登录再试。',
                      type: 'warning'
                    });
                  })
                }).catch(() => {
                  this.$message({
                    type: 'info',
                    message: '已取消操作!'
                  });
                });
           }else if(this.assessYear === "2024"){
             //保存
             this.$confirm('是否' + msgCont + '?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.pageLoading = true;
              const scort = {
                "scoreZp1": this.infoData[0].zpfz,
                "scoreZp2": this.infoData[this.hzColumn.zrlsqkColumn].zpfz,
                "scoreZp3": 30,
                "scoreZp4": this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].zpfz,
                "taskId": this.taskId
              };
              const params = {
                "infoData": this.infoData,
                "scorts": scort,
                "userInfo": this.userInfo,
                "task": this.task,
                "subType": subType, //保存状态
                "assessYear": this.assessYear,
                jlzbFile:this.jlzbFile,
              };
                  // params.jlzbFile = this.responseFile;
              saveInfoData2024(params).then(result => {
                if (result.result) {
                  this.pageLoading = false;
                  this.$alert('保存成功，如上报省委组织部，需再次点击上报按钮完成上报','提示', {
                    confirmButtonText: '确定',
                    type:"success",
                    callback: action => {
                      this.initFillingData(this.assessYear);
                    },
                  });
                }
              }).catch(err => {
                this.$message({
                  message: '系统错误，请重新登录再试。',
                  type: 'warning'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消操作!'
              });
            });
           }
          } else {
           if(this.assessYear === "2022" || this.assessYear === "2023"){
             //上报
             this.$confirm('是否' + msgCont + '?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning'
                }).then(() => {
                  this.pageLoading = true;
                  const scort = {
                    "scoreZp1": this.infoData[0].zpfz,
                    "scoreZp2": this.infoData[this.hzColumn.zrlsqkColumn].zpfz,
                    "scoreZp3": 30,
                    "scoreZp4": this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].zpfz,
                    "taskId": this.taskId
                  };
                  const params = {
                    "infoData": this.infoData,
                    "scorts": scort,
                    "userInfo": this.userInfo,
                    "task": this.task,
                    "subType": subType, //上报状态
                    "assessYear": this.assessYear,
                  };
                  saveInfoData(params).then(result => {
                    if (result.result) {
                      this.pageLoading = false;
                      this.$alert(msgCont+'成功!','提示', {
                        confirmButtonText: '确定',
                        type:"success",
                        callback: action => {
                          this.initFillingData(this.assessYear);
                        }
                      });
                    }
                  }).catch(err => {
                    this.$message({
                      message: '系统错误，请重新登录再试。',
                      type: 'warning'
                    });
                  })
                }).catch(() => {
                  this.$message({
                    type: 'info',
                    message: '已取消操作!'
                  });
                });
           }else if(this.assessYear === "2024"){
             //上报
             this.$confirm('是否' + msgCont + '?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.pageLoading = true;
              const scort = {
                "scoreZp1": this.infoData[0].zpfz,
                "scoreZp2": this.infoData[this.hzColumn.zrlsqkColumn].zpfz,
                "scoreZp3": 30,
                "scoreZp4": this.infoData[this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1].zpfz,
                "taskId": this.taskId
              };
              const params = {
                "infoData": this.infoData,
                "scorts": scort,
                "userInfo": this.userInfo,
                "task": this.task,
                "subType": subType, //上报状态
                "assessYear": this.assessYear,
                jlzbFile:this.jlzbFile,
              };
                  // params.jlzbFile = this.responseFile;
              saveInfoData2024(params).then(result => {
                if (result.result) {
                  this.pageLoading = false;
                  this.$alert(msgCont+'成功!','提示', {
                    confirmButtonText: '确定',
                    type:"success",
                    callback: action => {
                      this.initFillingData(this.assessYear);
                    }
                  });
                }
              }).catch(err => {
                this.$message({
                  message: '系统错误，请重新登录再试。',
                  type: 'warning'
                });
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消操作!'
              });
            });
           }
          }
        } else {
          return false;
        }
      });
    },
    //删除行
    delRow(){
      if(this.checkData.shzt == '1' || this.checkData.shzt == '5' || this.checkData == null || this.checkData.columnType != '1'){
        this.$message({
          message: '请选择一条合法数据进行删除。',
          type: 'warning'
        });
      }else {
        this.$confirm('是否删除选中行数据？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          //for循环删除数据
          this.infoData = this.infoData.filter((x) => x.id != this.checkData.id);
          if(this.checkData.pgbzId == '1'){
            this.hzColumn.dwdzColumn--;
            this.hzColumn.zrlsqkColumn--;
            this.hzColumn.jczbColumn--;
            this.sorts.dwdzSort--;
          }else if(this.checkData.pgbzId == '2'){
            this.hzColumn.zzrsbmColumn--;
            this.hzColumn.zrlsqkColumn--;
            this.hzColumn.jczbColumn--;
            this.sorts.zzrsbmSort--;
          }else if(this.checkData.pgbzId == '3'){
            this.hzColumn.fxcbColumn--;
            this.hzColumn.fxpyqkColumn--;
            this.hzColumn.jczbColumn--;
            this.sorts.fxcbSort--;
          }else if(this.checkData.pgbzId == '4'){
            this.hzColumn.pydlColumn--;
            this.hzColumn.fxpyqkColumn--;
            this.hzColumn.jczbColumn--;
            this.sorts.pydlSort--;
          }else if(this.checkData.pgbzId == '5'){
            this.hzColumn.gljdColumn--;
            this.hzColumn.fxpyqkColumn--;
            this.hzColumn.jczbColumn--;
            this.sorts.gljdSort--;
          }else if(this.checkData.pgbzId == '7'){
            this.hzColumn.jlzbColumn--;
            this.hzColumn.jlzbColumn1--;
            this.sorts.jlzbSort--;
          }
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除!'
          });
        });


      }
    },
    //选中操作
    handleCurrentChange(val) {
      this.checkData = val.row;
    },
    //新增按钮
    addNewCont(obj){
      //是当前行新增的数据
      console.log(obj,"obj")
      if(obj.pgbzId == '1'){
        this.hzColumn.dwdzColumn++;
        this.hzColumn.zrlsqkColumn++;
        this.hzColumn.jczbColumn++;
        this.handleInfoDataByAdd(obj,this.sorts.dwdzSort,this.sorts.dwdzSort);
        this.sorts.dwdzSort++;
        this.infoData.forEach(item => {
          if(item.pgbzId == '1'){
            item.zpfz = 30;
          }
        })
      }else if(obj.pgbzId == '2'){
        this.hzColumn.zzrsbmColumn++;
        this.hzColumn.zrlsqkColumn++;
        this.hzColumn.jczbColumn++;
        this.handleInfoDataByAdd(obj,this.sorts.zzrsbmSort + this.sorts.dwdzSort,this.sorts.zzrsbmSort);
        this.sorts.zzrsbmSort++;
      }else if(obj.pgbzId == '3'){
        this.hzColumn.fxcbColumn++;
        this.hzColumn.fxpyqkColumn++;
        this.hzColumn.jczbColumn++;
        this.handleInfoDataByAdd(obj,this.sorts.fxcbSort + this.sorts.zzrsbmSort + this.sorts.dwdzSort,this.sorts.fxcbSort);
        this.sorts.fxcbSort++;
        this.infoData.forEach(item => {
          if(item.pgbzId == '3'){
            item.zpfz = 30;
          }
        })
      }else if(obj.pgbzId == '4'){
        this.hzColumn.pydlColumn++;
        this.hzColumn.fxpyqkColumn++;
        this.hzColumn.jczbColumn++;
        this.handleInfoDataByAdd(obj,this.sorts.pydlSort + this.sorts.fxcbSort +
          this.sorts.zzrsbmSort + this.sorts.dwdzSort,this.sorts.pydlSort);
        this.sorts.pydlSort++;
      }else if(obj.pgbzId == '5'){
        this.hzColumn.gljdColumn++;
        this.hzColumn.fxpyqkColumn++;
        this.hzColumn.jczbColumn++;
        this.handleInfoDataByAdd(obj,this.sorts.gljdSort + this.sorts.pydlSort + this.sorts.fxcbSort +
          this.sorts.zzrsbmSort + this.sorts.dwdzSort,this.sorts.gljdSort);
        this.sorts.gljdSort++;
      }else if(obj.pgbzId == '7'){
        this.hzColumn.jlzbColumn++;
        this.hzColumn.jlzbColumn1++;
        this.handleInfoDataByAdd(obj,this.sorts.gljdSort + this.sorts.pydlSort + this.sorts.fxcbSort +
          this.sorts.zzrsbmSort + this.sorts.dwdzSort + 1 + this.sorts.jlzbSort,this.sorts.jlzbSort);
        this.sorts.jlzbSort++;
        this.infoData.forEach(item => {
          if(item.pgbzId == '7'){
            item.zpfz = 0;
          }
        })
      }
      console.log("this.infoData:",this.infoData)
    },
    //封装处理新增数据处理逻辑
    handleInfoDataByAdd(obj,arrayIndex,sort){
      this.infoData.splice(arrayIndex-1,0,{
        "id" : generateUUID(),
        "zbxm" : obj.zbxm,
        "pgnr" : obj.pgnr,
        "pgbz" : obj.pgbz,
        "gzjz" : "",
        "fileId" : [],
        "fileMc" : [],
        "fileUrl" : [],
        "fxjf" : "",
        "zpfz" : "",
        "shfz" : "",
        "columnType" : "1",//表格类型，1-填报，2-新增按钮
        "tsqksm" : "",//特殊情况说明
        "taskId" : obj.taskId,//任务id
        "pgbzId" : obj.pgbzId,//评估标准id
        "sort" : sort,//排序,
        "shzt":"0"
      })
    },
    //初始化table，合并单元格函数
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      if(this.assessYear === '2024'){
        if(columnIndex === 0){
          if (rowIndex === 0) {
            return {rowspan:this.hzColumn.jczbColumn,colspan:1}
          }else if (rowIndex === this.hzColumn.jczbColumn) {
            return {rowspan:this.hzColumn.jlzbColumn,colspan:1}
          }
          else if (rowIndex === (this.hzColumn.jczbColumn + this.hzColumn.jlzbColumn)) {
            return {rowspan:1,colspan:2}
          }else{
            return {rowspan:0,colspan:0}
          }
        }else if(columnIndex === 1){
          if(rowIndex === 0){
            return {rowspan:this.hzColumn.zrlsqkColumn,colspan:1}
          }else if(rowIndex === this.hzColumn.zrlsqkColumn){
            return {rowspan:this.hzColumn.fxpyqkColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn)){
            return {rowspan:1,colspan:1}
          }else if(rowIndex === (this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1)){ 
            return {rowspan:this.hzColumn.jlzbColumn1 + this.hzColumn.jlzbColumn2 ,colspan:1}
          }else if(rowIndex === (this.hzColumn.jczbColumn + this.hzColumn.jlzbColumn1 + this.hzColumn.jlzbColumn2)){
            return {rowspan:1,colspan:1}
          }else{
            return {rowspan:0,colspan:0}
          }
        }else if(columnIndex === 2){
          if(rowIndex === 0){
            return {rowspan:this.hzColumn.dwdzColumn,colspan:1}
          }else if(rowIndex === this.hzColumn.dwdzColumn){
            return {rowspan:this.hzColumn.zzrsbmColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn)){
            return {rowspan:this.hzColumn.fxcbColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn + this.hzColumn.fxcbColumn)){
            return {rowspan:this.hzColumn.pydlColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn + this.hzColumn.fxcbColumn
            + this.hzColumn.pydlColumn)){
            return {rowspan:this.hzColumn.gljdColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn +
            this.hzColumn.fxcbColumn + this.hzColumn.pydlColumn + this.hzColumn.gljdColumn)){
            return {rowspan:1,colspan:1}
          }
          else if(rowIndex === this.hzColumn.jczbColumn ){
            return {rowspan:this.hzColumn.jlzbColumn1 + this.hzColumn.jlzbColumn2,colspan:1}
          }
          // 新增的合并
          else if(rowIndex === (this.hzColumn.jczbColumn + this.hzColumn.jlzbColumn1 + this.hzColumn.jlzbColumn2 )){
            return {rowspan:1,colspan:1}
            // 新增的合并
          }else if(rowIndex === (this.hzColumn.jczbColumn + this.hzColumn.jlzbColumn )){
            return {rowspan:1,colspan:5}
          }else{
            return {rowspan:0,colspan:0}
          }
        }else if(columnIndex === 3){
          if(row.columnType === "2"){
            return {rowspan:1,colspan:4}
          }else if(row.columnType === "3"){
            if(row.pgbzId != '9999'){
              return {rowspan:0,colspan:0}
            }else{
              return {rowspan:1,colspan:5}
            }
          }if(row.columnType === "4"){
            return {rowspan:1,colspan:4}
          }else{
            return {rowspan:1,colspan:1}
          }

        }else if(columnIndex === 4){
          if(row.columnType === "2"){
            return {rowspan:0,colspan:0}
          }else if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }if(row.columnType === "4"){
            return {rowspan:0,colspan:0}
          }else{
            return {rowspan:1,colspan:1}
          }
        }else if(columnIndex === 5){
          if(row.columnType === "2"){
            return {rowspan:0,colspan:0}
          }else if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }if(row.columnType === "4"){
            return {rowspan:0,colspan:0}
          }else{
            return {rowspan:1,colspan:1}
          }
        }else if(columnIndex === 6){
          if(row.columnType === "2"){
            return {rowspan:0,colspan:0}
          }else if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }if(row.columnType === "4"){
            return {rowspan:0,colspan:0}
          }else{
            return {rowspan:1,colspan:1}
          }
        }else if (columnIndex === 7){
          if(row.columnType === "3"){
            if(row.pgbzId != '9999'){
              return {rowspan:1,colspan:2}
            }else{
              return {rowspan:0,colspan:0}
            }
          }else{
            if(rowIndex === 0){
              return {rowspan:this.hzColumn.zrlsqkColumn,colspan:1}
            }else if(rowIndex == this.hzColumn.zrlsqkColumn){
              return {rowspan:this.hzColumn.fxpyqkColumn,colspan:1}
            }else if(rowIndex == (this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1)){
              return {rowspan:this.hzColumn.jlzbColumn,colspan:1}
            }else{
              return {rowspan:1,colspan:1}
            }
          }
        }else if(columnIndex === 8){
          if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }else{
            if(rowIndex === 0){
              return {rowspan:this.hzColumn.zrlsqkColumn,colspan:1}
            }else if(rowIndex == this.hzColumn.zrlsqkColumn){
              return {rowspan:this.hzColumn.fxpyqkColumn,colspan:1}
            }else if(rowIndex == (this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1)){
              return {rowspan:this.hzColumn.jlzbColumn,colspan:1}
            }else{
              return {rowspan:1,colspan:1}
            }
          }
        }
      }else if(this.assessYear === '2022' || this.assessYear === '2023'){
        if(columnIndex === 0){
          if (rowIndex === 0) {
            return {rowspan:this.hzColumn.jczbColumn,colspan:1}
          }else if (rowIndex === this.hzColumn.jczbColumn) {
            return {rowspan:this.hzColumn.jlzbColumn,colspan:2}
          }else if (rowIndex === (this.hzColumn.jczbColumn + this.hzColumn.jlzbColumn)) {
            return {rowspan:1,colspan:2}
          }else if (rowIndex === (this.hzColumn.jczbColumn + this.hzColumn.jlzbColumn + 1)) {
            return {rowspan:1,colspan:3}
          }else{
            return {rowspan:0,colspan:0}
          }
        }else if(columnIndex === 1){
          if(rowIndex === 0){
            return {rowspan:this.hzColumn.zrlsqkColumn,colspan:1}
          }else if(rowIndex === this.hzColumn.zrlsqkColumn){
            return {rowspan:this.hzColumn.fxpyqkColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn)){
            return {rowspan:1,colspan:1}
          }else{
            return {rowspan:0,colspan:0}
          }
        }else if(columnIndex === 2){
          if(rowIndex === 0){
            return {rowspan:this.hzColumn.dwdzColumn,colspan:1}
          }else if(rowIndex === this.hzColumn.dwdzColumn){
            return {rowspan:this.hzColumn.zzrsbmColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn)){
            return {rowspan:this.hzColumn.fxcbColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn + this.hzColumn.fxcbColumn)){
            return {rowspan:this.hzColumn.pydlColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn + this.hzColumn.fxcbColumn
            + this.hzColumn.pydlColumn)){
            return {rowspan:this.hzColumn.gljdColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn +
            this.hzColumn.fxcbColumn + this.hzColumn.pydlColumn + this.hzColumn.gljdColumn)){
            return {rowspan:1,colspan:1}
          }else if (rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn +
            this.hzColumn.fxcbColumn + this.hzColumn.pydlColumn + this.hzColumn.gljdColumn + 1)){
            return {rowspan:this.hzColumn.jlzbColumn,colspan:1}
          }else if(rowIndex === (this.hzColumn.dwdzColumn + this.hzColumn.zzrsbmColumn +
            this.hzColumn.fxcbColumn + this.hzColumn.pydlColumn + this.hzColumn.gljdColumn
            + this.hzColumn.jlzbColumn + 1)){
            return {rowspan:1,colspan:5}
          }else{
            return {rowspan:0,colspan:0}
          }
        }else if(columnIndex === 3){
          if(row.columnType === "2"){
            return {rowspan:1,colspan:4}
          }else if(row.columnType === "3"){
            if(row.pgbzId != '9999'){
              return {rowspan:0,colspan:0}
            }else{
              return {rowspan:1,colspan:5}
            }
          }else{
            return {rowspan:1,colspan:1}
          }
        }else if(columnIndex === 4){
          if(row.columnType === "2"){
            return {rowspan:0,colspan:0}
          }else if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }else{
            return {rowspan:1,colspan:1}
          }
        }else if(columnIndex === 5){
          if(row.columnType === "2"){
            return {rowspan:0,colspan:0}
          }else if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }else{
            return {rowspan:1,colspan:1}
          }
        }else if(columnIndex === 6){
          if(row.columnType === "2"){
            return {rowspan:0,colspan:0}
          }else if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }else{
            return {rowspan:1,colspan:1}
          }
        }else if (columnIndex === 7){
          if(row.columnType === "3"){
            if(row.pgbzId != '9999'){
              return {rowspan:1,colspan:2}
            }else{
              return {rowspan:0,colspan:0}
            }
          }else{
            if(rowIndex === 0){
              return {rowspan:this.hzColumn.zrlsqkColumn,colspan:1}
            }else if(rowIndex == this.hzColumn.zrlsqkColumn){
              return {rowspan:this.hzColumn.fxpyqkColumn,colspan:1}
            }else if(rowIndex == (this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1)){
              return {rowspan:this.hzColumn.jlzbColumn,colspan:1}
            }else{
              return {rowspan:1,colspan:1}
            }
          }
        }else if(columnIndex === 8){
          if(row.columnType === "3"){
            return {rowspan:0,colspan:0}
          }else{
            if(rowIndex === 0){
              return {rowspan:this.hzColumn.zrlsqkColumn,colspan:1}
            }else if(rowIndex == this.hzColumn.zrlsqkColumn){
              return {rowspan:this.hzColumn.fxpyqkColumn,colspan:1}
            }else if(rowIndex == (this.hzColumn.zrlsqkColumn + this.hzColumn.fxpyqkColumn + 1)){
              return {rowspan:this.hzColumn.jlzbColumn,colspan:1}
            }else{
              return {rowspan:1,colspan:1}
            }
          }
        }
      }
    },
    cellClassName({ row,columnIndex}){
      // console.log(row,columnIndex,"row")
      if(row.zbxm && columnIndex == 0){
        return 'col-mode'
      }
      if(row.zbxm && columnIndex == 1){
        return 'col-writing'
      }
    },
    //单元格样式回调函数
    cellStyle(row, column, rowIndex, columnIndex){
      // if(row.columnIndex == 0){
      //   if(row.row.pgbzId != '9999'){
      //     return {"writing-mode":"vertical-lr","text-orientation":"upright","text-align":"center","font-size":"18px","font-weight":"900"};
      //   }else{
      //     return {"text-align":"center","font-size":"18px","font-weight":"900"};
      //   }

      // }
      // if(row.columnIndex == 1){
      //   return {"writing-mode":"vertical-lr","text-orientation":"upright","text-align":"center","font-size":"16px","font-weight":"900"};
      // }
    },
    //附件上传函数
    fileUpload(response, file, fileList, obj) {
      if(obj.pgbzId != '999'){
        let dataId = obj.id;//数据行id
        this.infoData.forEach(item =>{
          if(item.id == dataId){
            item.fileId.push(response.id);
            item.fileMc.push(file.name);
            item.fileUrl.push(response.url);
          }
        })
      }else{
        this.infoData.forEach(item =>{
          if(item.pgbzId == '999'){
            item.fileId.push(response.id);
            item.fileMc.push(file.name);
            item.fileUrl.push(response.url);
          }
        })
      }
    },
    //文件格式约束
    beforeAvatarUpload(file) {
      console.log(file,'beforeFile')
      const isPDF = file.name.substring(file.name.lastIndexOf('.') + 1) === 'pdf';
      const fileSize = file.size/1024
      if (fileSize > 2*1024){
        this.$message.error('上传附件材料不能大于2M!');
        return false
      }
      if (!isPDF) {
        this.$message.error('上传的附件材料后缀只能是.pdf的文件格式!');
      }
      return isPDF;
    },
    // 特色
    fileUploadFeature(response, file,  type,obj) {
      // let dataId = obj.id;
      this.jlzbFile.forEach((item)=>{
          if(item.fileType == type){
            item.fileId.push(response.id);
            item.fileMc.push(file.name);
            item.fileUrl.push(response.url);
          }
      })
    },
    // execl的后缀格式
    beforeExeclUpload(file) {
      const allowedExtensions = ['xlsx', 'xls', 'xlsm', 'xlsb', 'xltx', 'xltm', 'csv'];
      const isExcelFile = allowedExtensions.includes(file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase());

      const fileSize = file.size / 1024;
      if (fileSize > 2 * 1024) {
        this.$message.error('上传附件材料不能大于2M!');
        return false;
      }

      if (!isExcelFile) {
        this.$message.error('上传的附件材料后缀只能是.xlsx, .xls, .xlsm, .xlsb, .xltx, .xltm, 或 .csv 的文件格式!');
      }

      return isExcelFile;
    },
    //删除附件
    delFileBySort(sort,dataId){
      this.$confirm('是否删除该附件?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.infoData.forEach(item =>{
          if(item.id == dataId){
            item.fileId.splice(sort,1);
            item.fileMc.splice(sort,1);
            item.fileUrl.splice(sort,1);
          }
        })
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    delFileBySortFeature(sort,dataId){
      this.$confirm('是否删除该附件?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.jlzbFile.forEach(item =>{
          if(item.id == dataId){
            item.fileId.splice(sort,1);
            item.fileMc.splice(sort,1);
            item.fileUrl.splice(sort,1);
          }
        })
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    delFileByTsqk(sort){
      this.$confirm('是否删除该附件?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.infoData.forEach(item =>{
          if(item.pgbzId == '999'){
            item.fileId.splice(sort,1);
            item.fileMc.splice(sort,1);
            item.fileUrl.splice(sort,1);
          }
        })
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    //文件预览
    showFile(fileurl) {
      this.$nextTick(() => {
        this.$refs.dialogarchiveFile.initShow(fileurl)
      })
    },
    downFile(data, fileName) {
      if (!data) {
        return;
      }
      // 如果data是字符串并且看起来像一个URL，则直接构建a标签下载
      if (typeof data === "string" && data.startsWith("http")) {
        const a = document.createElement("a");
        a.style.display = "none";
        a.href = data;
        a.setAttribute("download", fileName);
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
      } else {
        // 对于Blob数据，保留原来的处理逻辑
        const url = window.URL.createObjectURL(new Blob([data]));
        const a = document.createElement("a");
        a.style.display = "none";
        a.href = url;
        a.setAttribute("download", fileName);
        document.body.appendChild(a);
        a.click();
        document.body.removeChild(a);
        window.URL.revokeObjectURL(url);
      }
    },
    showExeclFile(fileurl) {
      this.downFile(fileurl, "上传年度干部选拔表格名单");
    },
    //点击配备提升计划表
    showPbtsjh(shztGHB,type){
      if (this.assessYear == '2022') {
        this.$nextTick(() => {
          if (this.task.dwBianma) {
            if (Number(this.task.dwBianma) < 150000) {
              this.$refs.dialogpbtsjhTableSz.initShow(this.task, this.role, shztGHB, type)
            } else {
              this.$refs.dialogpbtsjhTableDs.initShow(this.task, this.role, shztGHB, type)
            }
          } else {
            this.$message({
              message: '用户数据丢失，请重新登录！',
              type: 'warning'
            });
          }
        })
      } else if (this.assessYear == '2023') {
        this.$nextTick(() => {
          const userNameNo = JSON.parse(sessionStorage.getItem(`userInfo`)).userAccount;
          if (userNameNo){
            if(userNameNo.indexOf("sz_") > -1){
              this.$refs.dialogpbtsjhTableSz2023.initShow(this.task,this.role,shztGHB,type)
            }else if (userNameNo.indexOf("sg_") > -1 || userNameNo.indexOf("ss_") > -1) {
              this.$refs.dialogpbtsjhTableSg2023.initShow(this.task,this.role,shztGHB,type)
            }else {
              this.$refs.dialogpbtsjhTableDs2023.initShow(this.task,this.role,shztGHB,type)
            }
          }else{
            this.$message({
              message: '用户数据丢失，请重新登录！',
              type: 'warning'
            });
          }
        });
      }else if(this.assessYear == '2024'){
        this.$nextTick(() => {
          const userNameNo = JSON.parse(sessionStorage.getItem(`userInfo`)).userAccount;
          if (userNameNo){
            if(userNameNo.indexOf("sz_") > -1){
              this.$refs.dialogpbtsjhTableSz2024.initShow(this.task,this.role,shztGHB,type)
            }else if (userNameNo.indexOf("sg_") > -1 || userNameNo.indexOf("ss_") > -1) {
              this.$refs.dialogpbtsjhTableSg2024.initShow(this.task,this.role,shztGHB,type)
            }else {
              this.$refs.dialogpbtsjhTableDs2024.initShow(this.task,this.role,shztGHB,type)
            }
          }else{
            this.$message({
              message: '用户数据丢失，请重新登录！',
              type: 'warning'
            });
          }
        });
      }
    },
    //点击完成情况统计表
    showWcqktj(shztGHB,type){
      if(this.assessYear == '2022'){
        this.$nextTick(() => {
          if (this.task.dwBianma){
            if(Number(this.task.dwBianma)  < 150000){
              this.$refs.dialogwcqktjTableSz.initShow(this.task,this.role,shztGHB,type)
            }else {
              this.$refs.dialogwcqktjTableDs.initShow(this.task,this.role,shztGHB,type)
            }
          }else{
            this.$message({
              message: '用户数据丢失，请重新登录！',
              type: 'warning'
            });
          }
        })
      }else if (this.assessYear == '2023'){
        this.$nextTick(() => {
          const userNameNo = JSON.parse(sessionStorage.getItem(`userInfo`)).userAccount;
          if (userNameNo){
            if(userNameNo.indexOf("sz_") > -1){
              this.$refs.dialogwcqktjTableSz2023.initShow(this.task,this.role,shztGHB,type)
            }else if (userNameNo.indexOf("sg_") > -1 || userNameNo.indexOf("ss_") > -1) {
              this.$refs.dialogwcqktjTableSg2023.initShow(this.task,this.role,shztGHB,type)
            }else {
              this.$refs.dialogwcqktjTableDs2023.initShow(this.task,this.role,shztGHB,type)
            }
          }else{
            this.$message({
              message: '用户数据丢失，请重新登录！',
              type: 'warning'
            });
          }
        });
      }
    },
    //点击推进情况统计表
    showTjqktj(shztGHB,type){
      if (this.assessYear == '2022') {
        this.$nextTick(() => {
          if (this.task.dwBianma) {
            if (Number(this.task.dwBianma) < 150000) {
              this.$refs.dialogtjqktjTableSz.initShow(this.task, this.role, shztGHB, type)
            } else {
              this.$refs.dialogtjqktjTableDs.initShow(this.task, this.role, shztGHB, type)
            }
          } else {
            this.$message({
              message: '用户数据丢失，请重新登录！',
              type: 'warning'
            });
          }
        })
      } else if (this.assessYear == '2023') {
        this.$nextTick(() => {
          const userNameNo = JSON.parse(sessionStorage.getItem(`userInfo`)).userAccount;
          if (userNameNo) {
            if (userNameNo.indexOf("sz_") > -1) {
              this.$refs.dialogtjqktjTableSz2023.initShow(this.task, this.role, shztGHB, type)
            } else if (userNameNo.indexOf("sg_") > -1 || userNameNo.indexOf("ss_") > -1) {
              this.$refs.dialogtjqktjTableSg2023.initShow(this.task, this.role, shztGHB, type)
            } else {
              this.$refs.dialogtjqktjTableDs2023.initShow(this.task, this.role, shztGHB, type)
            }
          } else {
            this.$message({
              message: '用户数据丢失，请重新登录！',
              type: 'warning'
            });
          }
        });
      }
    },
    //下载
    downZip(){
      //this.$refs.dialogtjqktjTableDs2023.initShow2()
      if(this.assessYear === "2022" || this.assessYear === "2023"){
        const month= new Date().getMonth() + 1;
        const params = {
          taskId: this.taskId,
          assessYear:this.assessYear,
          userNameNo : this.task.userNameNo,
          dwBianma : this.task.dwBianma,
          dw : this.task.dw,
          fileName:this.task.dw+"年轻干部工作督导评估量化赋分表(" +
            new Date().getFullYear() +"年"+month+ "月).zip"
        }
        this.$confirm('是否下载?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.pageLoading = true;
          downExecl(params).then(result => {
            this.pageLoading = false;
            // this.$alert('成功')
          })
        })
      }else if(this.assessYear === "2024"){
        const month= new Date().getMonth() + 1;
        const params = {
          taskId: this.taskId,
          assessYear:this.assessYear,
          userNameNo : this.task.userNameNo,
          dwBianma : this.task.dwBianma,
          dw : this.task.dw,
          fileName:this.task.dw+"年轻干部工作督导评估量化赋分表(" +
            new Date().getFullYear() +"年"+month+ "月).zip"
        }
        this.$confirm('是否下载?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.pageLoading = true;
          downExecl2024(params).then(result => {
            this.pageLoading = false;
            // this.$alert('成功')
          })
        })
      }
    },
    selectDateChange(){
      // this.initFillingData(new Date(this.assessYear).getFullYear())
      this.initFillingData(this.assessYear)
    },
    messageDate() {
      const month =new Date().getMonth() + 1 //月份
      const day =new Date().getDate() //日
      if(month==1 ||month==4 ||month==7 ||month==10){
        if(day==1){
          this.$alert('新季度需更新年轻干部进展情况', '提示', {
            confirmButtonText: '确定',
            type: 'warning',
            callback: action => {
            }
          });
        }
      }
    },
    selectSH(taskId){
      const params={
        taskId: taskId,
      }
      selectSH(params).then(result => {
        if(result.resultdata>0){
          this.$alert('年轻干部进展情况有反馈，请查看审核状态','提示', {
            confirmButtonText: '确定',
            type: 'warning',
            callback: action => {
              updateLogType(params).then(result => {

              })
            }
          });
        }

        // this.$alert('成功')
      })
    }

  }


}
</script>
<style scoped>
>>>.el-textarea.is-disabled .el-textarea__inner{
  color: #606266;
}
>>>.el-input.is-disabled .el-input__inner{
  color: #606266;
}
>>>.el-input__inner::placeholder{
  font-size:15px;
  font-weight: 700;
}
>>>.el-input__icon{
  color: #000000;
  font-weight: 700;
}
.custom-alert-message .el-message-box__message p {
  font-size: 18px;
  font-weight: bold;
}
/deep/tr.vxe-header--column{
  border: 1px solid #ebebeb !important;
}

/deep/.vxe-table--render-default.vxe-body--row.row--current{
  background-color: #e6f7ff;
}
/* >>>.vxe-body--column.col_3.col--center .vxe-cell span{
  writing-mode: vertical-lr;
  text-orientation: upright;
}
>>>.vxe-body--column.col_2.col--center .vxe-cell span{
  writing-mode: vertical-lr;
  text-orientation: upright;
} */
>>>.vxe-table--render-default .vxe-cell {
  white-space: pre-line;
  word-break: break-all;
  padding-left: 10px;
  padding-right: 10px;
}
>>>.vxe-table .vxe-body--row .vxe-body--column.col-mode .vxe-cell span{
  writing-mode: vertical-lr;
  text-orientation: upright;
  text-align:center;
  font-size:18px;
  font-weight:900;
}
>>>.vxe-table .vxe-body--row .vxe-body--column.col-writing .vxe-cell span{
  writing-mode: vertical-lr;
  text-orientation: upright;
  text-align:center;
  font-size:16px;
  font-weight:900;
}
</style>
